import request from '@/config/axios'

export interface weightVO {
  elecId: string,
  id: string,
  weight: number,
  proType: string,
  orderNo: string,
  flowWater: string
}


// 查询电子秤
export const getWeight = () => {
  return request.get({ url: '/project/electronic-scale-manage/onlineList'})
}

// 获取更新重量
export const updateMaWeight = (data) => {
  return request.post({ url: '/project/electronic-scale-manage/weight', data })
}

// 保存
export const updateWeight = (data: weightVO) => {
  return request.postOriginal({ url: '/project/internal-code/weight', data })
}

// 查询上次选中电子秤
export const getElecSelected = () => {
  return request.get({ url: '/project/electronic-scale-manage/getUsedScale' })
}

// 保存选中电子秤
export const savaElecSelected = (data) => {
  return request.post({ url: '/project/electronic-scale-manage/updateUsedScale', data })
}

// 查询电子秤通讯状态
export const getElecStatus = (data) => {
  return request.post({ url: '/project/electronic-scale-manage/check', data })
}